#ifndef OPERATION_H
#define OPERATION_H

#include <QObject>


class Memory;
class CPU;

class Operation : public QObject
{
    Q_OBJECT

public:
    Operation(QObject* parent = 0) : QObject(parent){}
    virtual ~Operation() {}
    //
    virtual void exec(const QString& IR) = 0;
};

class ADDOperation : public Operation
{
public:
    ADDOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~ADDOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class ADDIOperation : public Operation
{
public:
    ADDIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~ADDIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SUBOperation : public Operation
{
public:
    SUBOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SUBOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SUBIOperation : public Operation
{
public:
    SUBIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SUBIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class ANDOperation : public Operation
{
public:
    ANDOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~ANDOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class ANDIOperation : public Operation
{
public:
    ANDIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~ANDIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class OROperation : public Operation
{
public:
    OROperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~OROperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class ORIOperation : public Operation
{
public:
    ORIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~ORIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class XOROperation : public Operation
{
public:
    XOROperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~XOROperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class XORIOperation : public Operation
{
public:
    XORIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~XORIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class LHIOperation : public Operation
{
public:
    LHIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~LHIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SLLOperation : public Operation
{
public:
    SLLOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SLLOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SLLIOperation : public Operation
{
public:
    SLLIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SLLIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SRLOperation : public Operation
{
public:
    SRLOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SRLOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SRLIOperation : public Operation
{
public:
    SRLIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SRLIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SRAOperation : public Operation
{
public:
    SRAOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SRAOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SRAIOperation : public Operation
{
public:
    SRAIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SRAIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SLTOperation : public Operation
{
public:
    SLTOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SLTOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SLTIOperation : public Operation
{
public:
    SLTIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SLTIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SLEOperation : public Operation
{
public:
    SLEOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SLEOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SLEIOperation : public Operation
{
public:
    SLEIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SLEIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SEQOperation : public Operation
{
public:
    SEQOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SEQOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SEQIOperation : public Operation
{
public:
    SEQIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SEQIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SNEOperation : public Operation
{
public:
    SNEOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SNEOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SNEIOperation : public Operation
{
public:
    SNEIOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SNEIOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class LWOperation : public Operation
{
public:
    LWOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~LWOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SWOperation : public Operation
{
public:
    SWOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SWOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class LBOperation : public Operation
{
public:
    LBOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~LBOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class SBOperation : public Operation
{
public:
    SBOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~SBOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class BEQZOperation : public Operation
{
public:
    BEQZOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~BEQZOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class BNEZOperation : public Operation
{
public:
    BNEZOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~BNEZOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class JOperation : public Operation
{
public:
    JOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~JOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class JROperation : public Operation
{
public:
    JROperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~JROperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class JALOperation : public Operation
{
public:
    JALOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~JALOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class JALROperation : public Operation
{
public:
    JALROperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~JALROperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class TRAPOperation : public Operation
{
public:
    TRAPOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~TRAPOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};

class XFEOperation : public Operation
{
public:
    XFEOperation(CPU* _cpu, Memory* _memory, QObject* parent = 0);
    virtual ~XFEOperation();
    //
    virtual void exec(const QString &IR);
private:
    Memory* memory;
    CPU* cpu;
};
#endif // OPERATION_H
